package algebra;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;


public class Matrix extends AbstractMatrix {
	
	public double[][] data;
	
	
	public Matrix() { }
	
	public Matrix(double[][] array) {
		this.data = array;

		//this.Matrix();
	}
	
	public void readCsv(String fname) throws Exception {
		File f = new File(fname);
		
		BufferedReader br = new BufferedReader(new FileReader(f)); 
		  
		String st; 
		while ((st = br.readLine()) != null) 
		    System.out.println(st); 
		 
		 br.close();
	}


	public IMatrix add(IMatrix M) {
		// TODO Auto-generated method stub
		return null;
	}


	public IMatrix multiply(IMatrix M) {
		// TODO Auto-generated method stub
		return null;
	}


	public int[] shape() {
		int[] dim = {this.data.length, this.data[0].length};
		return dim;
	}
	
	public boolean isVect() {
		if (this.shape()[1] == 1) {
			return true;
		}
		else {
			return false;
		}
	}


	public double get(int i, int j) {
		// TODO Auto-generated method stub
		return this.data[i][j];
	}


	public double get(int i) {
		// TODO Auto-generated method stub
		return 0;
	}


	public void set(int i, int j, Object val) {
		this.data[i][j] = (Double)val;
	}


	public void set(int i, Object[] val) {
		
	}


	public void set(int i, Object val) {
		this.data[i][0] = (Double)val;
	}

	public int[] getShape() {
		// TODO Auto-generated method stub
		return null;
	}

}
